﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LiveMakkah.Pages;
using LiveMakkah.Utils;
using LiveMakkah.ViewModels;
using Xamarin.Forms;

namespace LiveMakkah
{
    public class App
    {
        public static NavigationPage MainNavigationPage;

        public static void RegisterTypes()
        {
            // This can be replaced by any number of MVVM tools. It is done this way merely because this 
            // is not intended to be a demo of those tools.
            ViewFactory.Register<ChannelListPage, ChannelListViewModel>();
            ViewFactory.Register<ChannelPage, ChannelViewModel>();
        }
        public static Page GetMainPage()
        {
            RegisterTypes();
            MainNavigationPage = new NavigationPage();
           
            MainNavigationPage.PushAsync(ViewFactory.CreatePage<ChannelListViewModel>());

            return MainNavigationPage;          
        }
    }
}
